<script setup>
defineProps({
  gameRequire: Array
})

const emit = defineEmits(["edit"])
const editHandle = () => {
  emit("edit", "gameRequire")
}
</script>

<template>
  <el-descriptions
      border
      :column="2"
      direction="vertical"
      title="游戏配置">
    <template #extra>
      <el-button @click="editHandle" type="success">修改</el-button>
    </template>
    <el-descriptions-item
        v-for="(item, index) in gameRequire"
        :key="index"
        :label="item.type === 0 ? '最低配置' : '推荐配置'">
      <el-descriptions border :column="3">
        <el-descriptions-item label="操作系统">{{ item.os }}</el-descriptions-item>
        <el-descriptions-item label="处理器">{{ item.cpu }}</el-descriptions-item>
        <el-descriptions-item label="内存">{{ item.ram }}G</el-descriptions-item>
        <el-descriptions-item label="显卡">{{ item.gpu }}</el-descriptions-item>
        <el-descriptions-item label="DirectX版本">{{ item.dx }}</el-descriptions-item>
        <el-descriptions-item label="游戏大小">{{ item.size }}</el-descriptions-item>
      </el-descriptions>
    </el-descriptions-item>
  </el-descriptions>
</template>

<style scoped>

</style>
